﻿using System;
using System.Web.UI;
using WEATHER.Components;
using ASPNETVN.PORTAL.Components.Helpers;
using System.Web;

namespace WEATHER.Modules.ONLINE.Pages
{
    public partial class ProvinceWeather : Page
    {
        protected int MaxOfID;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack == false)
            {
                Guid mid = new Guid(Request.QueryString["mid"]);
                ContentPane.InnerHtml = HttpUtility.HtmlDecode(Province.GetWeatherDetailOnline(mid, "/21/92"));
                //ContentPane.InnerHtml = HttpUtility.HtmlDecode(Province.GetWeatherDetailOffline(mid, "/21/92"));

                //editLink.NavigateUrl = HttpUrlBuilder.BuildUrl(mid, Item.MaxOfID("CurrentWeather"), "AddEditItem") + "&WeatherType=CurrentWeather";
                //editLink.Visible = Boolean.Parse(Request.QueryString["edit"]);                
            }
        }

        protected void butView_Click(object sender, EventArgs e)
        {
            Guid mid = new Guid(Request.QueryString["mid"]);
            Response.Redirect("~/Modules/WEATHER.Modules.ONLINE/Pages/ProvinceWeatherDetail.aspx?mid=" + mid + "&ProvinceCode=" + HttpUtility.UrlEncode(ddlProvinces.SelectedValue));
        }
    }
}
